package fr.chrysalis.ui.components.core
{
	import flash.display.MovieClip;
	import flash.text.Font;
	
	import fr.chrysalis.ui.assets.SWFAsset;
	import fr.chrysalis.ui.components.interfaces.IComponent;
	
	public class Font extends Component implements IComponent
	{
		public function Font(asset:SWFAsset)
		{
			super(asset);
			
			var bounds:MovieClip = new MovieClip();
			bounds.name = 'bounds';
			bounds.width = 0;
			bounds.height = 0;
			
			this.element.addChild(bounds);
			this.element.bounds = bounds;
			
			
		}
		
		public static function enumerateEmbededFonts():void{
			var embeddedFonts:Array = flash.text.Font.enumerateFonts(false);
			embeddedFonts.sortOn("fontName", Array.CASEINSENSITIVE);
			trace("\n----- Polices embeded -----");
			for(var i:int = 0; i<embeddedFonts.length; i++) {
				trace(embeddedFonts[i].fontName + ' ' + embeddedFonts[i].fontStyle + ' ' + embeddedFonts[i].fontType);
			}
			trace("---------------------------\n");
		}
	}
}